package team.fjut.cf.pojo.enums;

import lombok.Data;

/**
 * @author liweihao
 */

public enum ACBChangeType {

    OTHER(-1, "其他"),
    AC(0, "AC一题"),
    CHECK_IN(1, "签到"),
    MALL_TRADE(2, "商城交易");


    private int id;
    private String name;

    ACBChangeType(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByID(int id) {
        for (ACBChangeType t : ACBChangeType.values()) {
            if (t.getId() == id) {
                return t.getName();
            }
        }
        return null;
    }

    public static Integer getIdByName(String name) {
        for (ACBChangeType t : ACBChangeType.values()) {
            if (t.getName().equals(name)) {
                return t.getId();
            }
        }
        return null;
    }


}
